//
//  DBJRegisterViewController.m
//  DBJ
//
//  Created by 花化华 on 2016/11/13.
//  Copyright © 2016年 itcast. All rights reserved.
//

#import "DBJRegisterViewController.h"
#import <Masonry.h>
#import "RadioButton.h"
#import "DBJApplyforDoctorViewController.h"
#import "DBJIllnessTableViewController.h"
#import "DBJIllnessListModel.h"
#import <SVProgressHUD.h>
#import "MBProgressHUD.h"
#import "DBJAttentionDoctorTableViewController.h"
#import "DBJNetworkTool.h"
@interface DBJRegisterViewController ()


@property(strong,nonatomic)UIView *cureMethod;

@property(weak,nonatomic)RadioButton *appearRadio;

@property(weak,nonatomic)RadioButton *hiddenRadio;

@property(strong,nonatomic)NSArray<DBJIllnessListModel *> *illList;
@property(weak,nonatomic)UILabel *illTypeLabel;

@property(strong,nonatomic)NSArray<DBJIllnessListModel *> *concurrentList;
@property(weak,nonatomic)UILabel *cureMethodLabel;

@property(weak,nonatomic)UILabel *complicationLabel;
@property(weak,nonatomic)UIView *complicationView;
@property(weak,nonatomic)UIButton *applyBtn;

@property(strong,nonatomic)UILabel *MatchCountsLabel;
@property(strong,nonatomic)UILabel *MatchCountsLabel2;
@property(strong,nonatomic)UIImageView *MatchCountsImg;
@property(weak,nonatomic)RadioButton *radioBtn1;
@property(copy,nonatomic)NSString *counts;
@end

@implementation DBJRegisterViewController

- (void)dbjSetupSubviews{
    [super dbjSetupSubviews];
    [self loadData];
    [self setIllnessTypeLabel];
    [self setIllnessChoose];
    [self setApplyforCure];
    
    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
        [self appearMatchCounts];
    });
}

-(void)viewDidAppear:(BOOL)animated
{
    //[self appearMatchCounts];
}
-(void)appearMatchCounts{
    UILabel *label = [UILabel hm_labelWithText:@"一共为您匹配到" fontSize:18 color:[UIColor grayColor]];
    label.textAlignment = NSTextAlignmentCenter;
    [self.view addSubview:label];
    
    
    UILabel *label2 = [UILabel hm_labelWithText:[NSString stringWithFormat:@"%@位医生",self.counts] fontSize:20 color:DBJColor];
    label2.textAlignment = NSTextAlignmentCenter;
    [self.view addSubview:label2];
    
    UIImageView *imgView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"illness_img_person.png"]];
    [self.view addSubview:imgView];
    
    //设置约束
    if ([UIScreen mainScreen].bounds.size.width<375) {
        [imgView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerX.equalTo(self.applyBtn);
            make.bottom.equalTo(self.applyBtn.mas_top).mas_offset(-8);
        }];
        
        [label2 mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerX.equalTo(imgView);
            make.bottom.equalTo(imgView.mas_top).mas_offset(-4);
        }];
        
        [label mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerX.equalTo(label2);
            make.bottom.equalTo(label2.mas_top).mas_offset(-4);
        }];

    }else
    {
        [imgView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerX.equalTo(self.applyBtn);
            make.bottom.equalTo(self.applyBtn.mas_top).mas_offset(-32);
        }];
        
        [label2 mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerX.equalTo(imgView);
            make.bottom.equalTo(imgView.mas_top).mas_offset(-16);
        }];
        
        [label mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerX.equalTo(label2);
            make.bottom.equalTo(label2.mas_top).mas_offset(-16);
        }];

    }
    //隐藏
    label.hidden = YES;
    label2.hidden = YES;
    imgView.hidden = YES;
    
    self.MatchCountsImg = imgView;
    self.MatchCountsLabel2 = label2;
    self.MatchCountsLabel = label;
}
/**
 设置申请预约
 */
-(void)setApplyforCure{
    UIButton *btn = [[UIButton alloc]init];
    btn.backgroundColor = [UIColor grayColor];
    [btn setTitle:@"申请预约" forState:UIControlStateNormal];
    [btn setTintColor:[UIColor whiteColor]];
    [self.view addSubview:btn];
    //设置约束
    [btn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self.view);
        make.bottom.equalTo(self.view).mas_offset(-16);
        make.width.mas_equalTo(300);
        make.height.mas_equalTo(40);
    }];
    btn.layer.cornerRadius = 10;
    btn.userInteractionEnabled = NO;
    [btn addTarget:self action:@selector(applyforCure:) forControlEvents:UIControlEventTouchUpInside];
    self.applyBtn = btn;
}

-(void)applyforCure:(UIButton *)sender{
    DBJAttentionDoctorTableViewController *docList = [[DBJAttentionDoctorTableViewController alloc]init];
    [self.navigationController pushViewController:docList animated:YES];
    self.navigationItem.backBarButtonItem.title = @"返回申请";
}
/**
 设置疾病类型label
 */
-(void)setIllnessTypeLabel{
    UILabel *label = [UILabel hm_labelWithText:[NSString stringWithFormat:@"  疾病类型:%@",self.title] fontSize:17 color:[UIColor grayColor]];
    [self.view addSubview:label];
    //设置约束
    [label mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.mas_topLayoutGuideBottom).mas_offset(24);
        make.left.equalTo(self.view).mas_offset(16);
        make.trailing.equalTo(self.view).mas_equalTo(-16);
        make.height.mas_equalTo(30);
    }];
    //记录
    self.type = label;
}

/**
 设置疾病情况选择
 */
-(void)setIllnessChoose{
        /*------------* 疾病类型选择 *-------------*/
    UIView *illType = [[UIView alloc]init];
    illType.backgroundColor = [UIColor whiteColor];
    [self.view addSubview:illType];
    //设置约束
    [illType mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.type.mas_bottom).mas_offset(16);
        make.left.right.equalTo(self.type);
        make.height.mas_equalTo(40);
    }];
    illType.layer.cornerRadius = 10;
    //添加label
    UILabel *illTypeLabel = [[UILabel alloc]init];
    illTypeLabel.text = @"请选择疾病类型:";
    illTypeLabel.textColor = DBJColor;
    [illType addSubview:illTypeLabel];
    [illTypeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.left.equalTo(illType).mas_offset(5);
        make.bottom.equalTo(illType).mas_offset(-5);
        make.width.equalTo(illType).multipliedBy(0.5);
    }];
    self.illTypeLabel = illTypeLabel;
    //添加小图标
    UIButton *illTypeBtn = [[UIButton alloc]init];
    [illTypeBtn setImage:[UIImage imageNamed:@"position-right"] forState:UIControlStateNormal];
    [illTypeBtn setImage:[UIImage imageNamed:@"steparr"] forState:UIControlStateHighlighted];
    [illType addSubview:illTypeBtn];
    [illTypeBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.width.mas_equalTo(18);
        make.height.mas_equalTo(27);
        make.trailing.equalTo(illType).mas_offset(-16);
        make.centerY.equalTo(illType);
    }];
    //添加手势
    UITapGestureRecognizer *tapType = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(chooseMethod:)];
    [illType addGestureRecognizer:tapType];
    
        /*------------* 选择并发症 *-------------*/
    UIView *complication = [[UIView alloc]init];
    complication.backgroundColor = [UIColor whiteColor];
    [self.view addSubview:complication];
    //设置约束
    [complication mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(illType.mas_bottom).mas_offset(16);
        make.left.right.equalTo(illType);
        make.height.mas_equalTo(40);
    }];
    complication.layer.cornerRadius = 10;
    //添加label
    UILabel *complicationLabel = [[UILabel alloc]init];
    complicationLabel.text = @"请选择并发症(多选):";
    complicationLabel.textColor = DBJColor;
    [complication addSubview:complicationLabel];
    [complicationLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.left.equalTo(complication).mas_offset(5);
        make.bottom.equalTo(complication).mas_offset(-5);
        make.width.equalTo(complication).multipliedBy(0.5);
    }];
    self.complicationLabel = complicationLabel;
    //添加小图标
    UIButton *complicationBtn = [[UIButton alloc]init];
    [complicationBtn setImage:[UIImage imageNamed:@"position-right"] forState:UIControlStateNormal];
    [complicationBtn setImage:[UIImage imageNamed:@"steparr"] forState:UIControlStateHighlighted];
    [complication addSubview:complicationBtn];
    [complicationBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.width.mas_equalTo(18);
        make.height.mas_equalTo(27);
        make.trailing.equalTo(complication).mas_offset(-16);
        make.centerY.equalTo(complication);
    }];
    //添加手势
    UITapGestureRecognizer *tapComplication = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(chooseConcurrent:)];
    [complication addGestureRecognizer:tapComplication];
    self.complicationView = complication;
    
        /*------------* 是否确诊 *-------------*/
    UIView *diagnose = [[UIView alloc]init];
    diagnose.backgroundColor = [UIColor whiteColor];
    [self.view addSubview:diagnose];
    //设置约束
    [diagnose mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(complication.mas_bottom).mas_offset(16);
        make.left.right.equalTo(complication);
        make.height.mas_equalTo(40);
    }];
    diagnose.layer.cornerRadius = 10;
    //添加label
    UILabel *diagnoseLabel = [[UILabel alloc]init];
    diagnoseLabel.text = @"是否已确诊:";
    diagnoseLabel.textColor = DBJColor;
    [diagnose addSubview:diagnoseLabel];
    [diagnoseLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.left.equalTo(diagnose).mas_offset(5);
        make.bottom.equalTo(diagnose).mas_offset(-5);
        make.width.equalTo(diagnose).multipliedBy(0.5);
    }];
    //设置单选按钮
    RadioButton *radio1 = [[RadioButton alloc]init];
    [radio1 setImage:[UIImage imageNamed:@"illness_rb_img_nor.png"] forState:UIControlStateNormal];
    [radio1 setImage:[UIImage imageNamed:@"illness_rb_img_sel.png"] forState:UIControlStateSelected];
    [diagnose addSubview:radio1];
    //设置约束
    [radio1 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.width.mas_equalTo(15);
        make.height.mas_equalTo(15);
        make.left.equalTo(diagnoseLabel.mas_right).mas_offset(8);
        make.centerY.equalTo(diagnose);
    }];
    //添加label
    UILabel *diagnoseYES = [UILabel hm_labelWithText:@"确诊" fontSize:15 color:DBJColor];
    [diagnose addSubview:diagnoseYES];
    [diagnoseYES mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(radio1);
        make.left.equalTo(radio1.mas_right).mas_offset(6);
    }];
    //设置单选按钮
    RadioButton *radio2 = [[RadioButton alloc]init];
    [radio2 setImage:[UIImage imageNamed:@"illness_rb_img_nor.png"] forState:UIControlStateNormal];
    [radio2 setImage:[UIImage imageNamed:@"illness_rb_img_sel.png"] forState:UIControlStateSelected];
    [diagnose addSubview:radio2];
    //设置约束
    [radio2 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.width.mas_equalTo(15);
        make.height.mas_equalTo(15);
        make.left.equalTo(diagnoseYES.mas_right).mas_offset(16);
        make.centerY.equalTo(diagnose);
    }];
    //添加label
    UILabel *diagnoseNO = [UILabel hm_labelWithText:@"疑似" fontSize:15 color:DBJColor];
    [diagnose addSubview:diagnoseNO];
    [diagnoseNO mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(radio2);
        make.left.equalTo(radio2.mas_right).mas_offset(6);
    }];
    //设置一组单选按钮
    radio1.groupButtons = @[radio1,radio2];
    self.radioBtn1 = radio1;
    
        /*------------* 是否接收过治疗 *-------------*/
    UIView *cure = [[UIView alloc]init];
    cure.backgroundColor = [UIColor whiteColor];
    [self.view addSubview:cure];
    //设置约束
    [cure mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(diagnose.mas_bottom).mas_offset(16);
        make.left.right.equalTo(diagnose);
        make.height.mas_equalTo(40);
    }];
    cure.layer.cornerRadius = 10;
    //添加label
    UILabel *cureLabel = [UILabel hm_labelWithText:@"是否有医疗史" fontSize:17 color:DBJColor];
    [cure addSubview:cureLabel];
    [cureLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.left.equalTo(cure).mas_offset(5);
        make.bottom.equalTo(cure).mas_offset(-5);
        make.width.equalTo(cure).multipliedBy(0.5);
    }];
    //设置单选按钮
    RadioButton *radio3 = [[RadioButton alloc]init];
    [radio3 setImage:[UIImage imageNamed:@"illness_rb_img_nor.png"] forState:UIControlStateNormal];
    [radio3 setImage:[UIImage imageNamed:@"illness_rb_img_sel.png"] forState:UIControlStateSelected];
    [radio3 addTarget:self action:@selector(appearCureMethod:) forControlEvents:UIControlEventTouchUpInside];
    [cure addSubview:radio3];
    //设置约束
    [radio3 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.width.mas_equalTo(15);
        make.height.mas_equalTo(15);
        make.left.equalTo(cureLabel.mas_right).mas_offset(8);
        make.centerY.equalTo(cure);
    }];
    
    self.appearRadio = radio3;
    //添加label
    UILabel *cureYES = [UILabel hm_labelWithText:@"存在" fontSize:15 color:DBJColor];
    [cure addSubview:cureYES];
    [cureYES mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(radio3);
        make.left.equalTo(radio3.mas_right).mas_offset(6);
    }];
    
    //设置单选按钮
    RadioButton *radio4 = [[RadioButton alloc]init];
    [radio4 setImage:[UIImage imageNamed:@"illness_rb_img_nor.png"] forState:UIControlStateNormal];
    [radio4 setImage:[UIImage imageNamed:@"illness_rb_img_sel.png"] forState:UIControlStateSelected];
    [radio4 addTarget:self action:@selector(appearCureMethod:) forControlEvents:UIControlEventTouchUpInside];
    [cure addSubview:radio4];
    //设置约束
    [radio4 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.width.mas_equalTo(15);
        make.height.mas_equalTo(15);
        make.left.equalTo(cureYES.mas_right).mas_offset(16);
        make.centerY.equalTo(cure);
    }];
    
    self.hiddenRadio = radio4;
    //添加label
    UILabel *cureNO = [UILabel hm_labelWithText:@"没有" fontSize:15 color:DBJColor];
    [cure addSubview:cureNO];
    [cureNO mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(radio4);
        make.left.equalTo(radio4.mas_right).mas_offset(6);
    }];
    //设置一组单选按钮
    radio3.groupButtons = @[radio3,radio4];

        /*------------* 曾经采用的治疗方式 *-------------*/
    UIView *cureMethod = [[UIView alloc]init];
    cureMethod.backgroundColor = [UIColor whiteColor];
    [self.view addSubview:cureMethod];
    //设置约束
    [cureMethod mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(cure.mas_bottom).mas_offset(16);
        make.left.right.equalTo(cure);
        make.height.mas_equalTo(40);
    }];
    cureMethod.layer.cornerRadius = 10;
    //添加label
    UILabel *cureMethodLabel = [UILabel hm_labelWithText:@"曾经的治疗方式:" fontSize:17 color:DBJColor];
    [cureMethod addSubview:cureMethodLabel];
    [cureMethodLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.left.equalTo(cureMethod).mas_offset(5);
        make.bottom.equalTo(cureMethod).mas_offset(-5);
        make.width.equalTo(cureMethod).multipliedBy(0.5);
    }];
    self.cureMethodLabel = cureMethodLabel;
    //添加小图标
    UIButton *cureMethodBtn = [[UIButton alloc]init];
    [cureMethodBtn setImage:[UIImage imageNamed:@"position-right"] forState:UIControlStateNormal];
    [cureMethodBtn setImage:[UIImage imageNamed:@"steparr"] forState:UIControlStateHighlighted];
    [cureMethod addSubview:cureMethodBtn];
    [cureMethodBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.width.mas_equalTo(18);
        make.height.mas_equalTo(27);
        make.trailing.equalTo(cureMethod).mas_offset(-16);
        make.centerY.equalTo(cureMethod);
    }];
    //添加手势
    UITapGestureRecognizer *tapCure = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(chooseDidCureMethod:)];
    [cureMethod addGestureRecognizer:tapCure];
    //[cureMethod setHidden:YES];
    cureMethod.alpha = 0;
    self.cureMethod = cureMethod;
}

-(void)loadData{
    NSString *url = @"http://iosapi.itcast.cn/doctor/searchCI3List.json.php";
    NSArray *arr = @[@{@"page":@1,@"page_size":@15,@"ci1_id":@1,@"keyword":@""},@{@"page":@1,@"page_size":@15,@"ci1_id":@3,@"keyword":@""},@{@"page":@1,@"page_size":@15,@"ci1_id":@4,@"keyword":@""},@{@"page":@1,@"page_size":@15,@"ci1_id":@2,@"keyword":@""},@{@"page":@1,@"page_size":@15,@"ci1_id":@5,@"keyword":@""}];
    NSDictionary *para;
    if ([self.title isEqualToString:@"肿瘤"]) {
        para = arr[0];
    }else if ([self.title isEqualToString:@"心血管"])
    {
        para = arr[1];
    }else if ([self.title isEqualToString:@"神经科"])
    {
        para = arr[2];
    }else if([self.title isEqualToString:@"血液科"])
    {
        para = arr[3];
    }else if([self.title isEqualToString:@"骨科"])
    {
        para = arr[4];
    }
    [DBJIllnessListModel getDoctorListDataWithURLString:url andParameters:para andSuccessBlock:^(NSArray *newsList) {
        self.illList = newsList;
    } andErrorBlock:^(NSError *error) {
        NSLog(@"%@",error);
    }];
    
        /*------------* 并发症 *-------------*/
    NSString *concurrentURL = @"http://iosapi.itcast.cn/doctor/complicationList.json.php";
    NSDictionary *parameters = @{@"page":@1,@"page_size":@15,@"ci1_id":@1,@"ci2_id":@3};
    [DBJIllnessListModel getDoctorListDataWithURLString:concurrentURL andParameters:parameters andSuccessBlock:^(NSArray *newsList) {
        self.concurrentList = newsList;
    } andErrorBlock:^(NSError *error) {
        NSLog(@"%@",error);
    }];
    
        /*------------* 下载匹配医生数量 *-------------*/
    NSString *URL = @"http://iosapi.itcast.cn/doctor/matchedDoctorCount.json.php";
    NSDictionary *aparameters = @{@"ci1_id":@1,@"ci2_id":@3,@"ci3_id":@3,@"diagnosis_type":@0,@"is_confirmed":@1,@"user_id":@1000089, @"has_diagnosis":@2};
    [[DBJNetworkTool sharedNetworkTool] POSTWithURLString:URL parameters:aparameters success:^(id responseObject) {
        NSDictionary *dict = [NSJSONSerialization JSONObjectWithData:responseObject options:0 error:nil];
        NSDictionary *data = dict[@"data"];
         self.counts = data[@"doctor_count"];
    } faile:^(NSError *error) {
        NSLog(@"%@",error);
    }];
       }
/**
 跳转选择具体页面
 */
-(void)chooseMethod:(UITapGestureRecognizer *)sender{
    DBJIllnessTableViewController *illnessDetail = [[DBJIllnessTableViewController alloc]init];
    [illnessDetail setIllBlock:^(NSString *str) {
        self.illTypeLabel.text = str;
    }];
    illnessDetail.illTypes = self.illList;
    
    [self.navigationController pushViewController:illnessDetail animated:YES];
    
    self.MatchCountsLabel.hidden = YES;
    self.MatchCountsLabel2.hidden = YES;
    self.MatchCountsImg.hidden = YES;
    self.applyBtn.userInteractionEnabled = NO;
    self.applyBtn.backgroundColor = [UIColor grayColor];
    for (UILabel *label in self.complicationView.subviews) {
        [label setHidden:YES];
    }
    [self.complicationLabel setHidden:NO];
    self.complicationLabel.text = @"请选择并发症(多选):";
    [self.radioBtn1 deselectAllButtons];
    [self.appearRadio deselectAllButtons];
    self.cureMethod.alpha = 0;
    self.cureMethodLabel.text = @"曾经的治疗方式";
}

/**
 跳转并发症页面
 */
-(void)chooseConcurrent:(UITapGestureRecognizer *)sender{
    [SVProgressHUD setMinimumDismissTimeInterval:1];
    DBJIllnessTableViewController *illnessDetail = [[DBJIllnessTableViewController alloc]init];
    if ([self.illTypeLabel.text isEqualToString:@"请选择疾病类型:"]){
        [SVProgressHUD showErrorWithStatus:@"请先选择疾病类型"];
        return;
    }
    else if ([self.illTypeLabel.text isEqualToString:@"胃恶性肿瘤"]){
        illnessDetail.illTypes = self.concurrentList;
    }
    else{
         [SVProgressHUD showErrorWithStatus:@"没有并发症"];
        return;
    }
    [illnessDetail setConcurrentBlock:^(NSDictionary *dict) {
        NSString *key = dict.keyEnumerator.nextObject;
        if (key) {
            [self.complicationLabel setHidden:YES];
            int __block index = 0;
            [dict enumerateKeysAndObjectsUsingBlock:^(id  _Nonnull key, id  _Nonnull obj, BOOL * _Nonnull stop) {
                //控制标签数量
                if (index >= 4) {
                    return ;
                }
                //循环创建label
                UILabel *label = [UILabel hm_labelWithText:dict[key] fontSize:15 color:[UIColor whiteColor]];
                [self.complicationView addSubview:label];
                label.backgroundColor = DBJColor;
                label.textAlignment = NSTextAlignmentCenter;
                CGFloat width = 55;
                CGFloat height = 20;
                CGFloat x = 8;
                CGFloat y = 10;
                label.frame = CGRectMake(x+(width+5)*index, y, width, height);
                label.layer.cornerRadius = 6;
                label.layer.masksToBounds = YES;
                
                index++;
                
            }];
        }
            }];
    
    [self.navigationController pushViewController:illnessDetail animated:YES];
}

-(void)chooseDidCureMethod:(UITapGestureRecognizer *)sender{
    DBJIllnessTableViewController *illnessDetail = [[DBJIllnessTableViewController alloc]init];
    illnessDetail.didCure = @[@"手术治疗",@"药物治疗",@"保守察看"];
    [illnessDetail setIllBlock:^(NSString *str) {
        self.cureMethodLabel.text =str;
    }];
     [self.navigationController pushViewController:illnessDetail animated:YES];
}
/**
 单选按钮控制
 */
-(void)appearCureMethod:(RadioButton *)sender{
    [SVProgressHUD setMinimumDismissTimeInterval:1.0];
    if ([self.illTypeLabel.text isEqualToString:@"请选择疾病类型:"]){
        [SVProgressHUD showErrorWithStatus:@"请先选择疾病类型"];
        [sender deselectAllButtons];
        return;
    }
    if (sender == self.appearRadio) {
        [UIView animateWithDuration:1.0 animations:^{
            self.cureMethod.alpha = 1;
        }];
    }
    else if(sender == self.hiddenRadio){
        [UIView animateWithDuration:1.0 animations:^{
            self.cureMethod.alpha = 0;
        }];
    }
    self.applyBtn.userInteractionEnabled = YES;
    [UIView animateWithDuration:2.0 animations:^{
        self.MatchCountsLabel.hidden = NO;
        self.MatchCountsLabel2.hidden = NO;
        self.MatchCountsImg.hidden = NO;
    }];
    self.applyBtn.backgroundColor = DBJColor;
}
@end
